package com.ws.test02.entity;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author 王硕
 * @version jdk21
 * @className worker
 * @description
 * @date 2024/11/21 16:59
 */
@Data
@Accessors(chain = true)
public class Worker {
    private String name;
    private Integer age;
    private Double salary;
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        Worker worker = (Worker) obj;
        return age.equals(worker.age) && Double.compare(worker.salary, salary) == 0 && (name != null ? name.equals(worker.name) : worker.name == null);
    }
}
